/**
 * 
 */
$(document).ready(function() {
	
	var id = window.location.search.split("=")[1];
	
	 
	$('#comfirm').click(function(){
		var id = $("#id").val(); 
		var name = $("#name").val(); 
		var password = $("#password").val(); 
		var comfirmPwd = $("#comfirmPwd").val(); 
		if(comfirmPwd != password){
			alert("密码不一致");
			return ;
		}
		if(name == ""){
			alert("用户名不能为空");
			return ;
		}
		$.ajax({
			type:"get",
			url :"user/addUser?id="+id+"&name="+name+"&password="+password,
			dateType:"json",
			success:function(){
				alert("添加成功");
				history.back(-1);
			},
			error: function(){
				alert("添加失败");
			}
		});
	});

});